//========encoding:utf-8=========
/*
 * @describe:  三目运算符
 * @author:mhao
 * @copyright:chinasoft.cn
 * @date:2020年2月10日   下午8:32:44
 */
package edu.chinasoft.util;

import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletRequestWrapper;

import org.apache.log4j.Logger;

public class HttpServeltRequestExtend extends HttpServletRequestWrapper{
	private static Logger logger = Logger.getLogger( HttpServeltRequestExtend .class);
	private HttpServletRequest request;
	public HttpServeltRequestExtend(HttpServletRequest request) {
		super(request);
		// TODO Auto-generated constructor stub
		this.request=request;
	}
	@Override
	public String getParameter(String name) {
		// TODO Auto-generated method stub
		logger.debug("HttpServeltRequestExtend>>>getParameter   start ……");
		String result=null;
		//获取请求里的内容
		result = this.request.getParameter(name);
		try {
			//对获取到内容进行URL解码
			result= URLDecoder.decode(result, "utf-8");
		} catch (UnsupportedEncodingException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		logger.debug("HttpServeltRequestExtend>>>getParameter   end ……");
		return result;
	}

}
